UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's9mhbv26g41h1vgeXLygHL9wQpxclVpr7Pyo5EAPiyU='
WHERE
key_id = 'ac450fd7e2037103d7f64b5e1020910c3316ca23fd675279f9fe09f6edcdff93'
AND (
token = 's9mhbv26g41h1vgeXLygHL9wQpxclVpr7Pyo5EAPiyU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)