UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rph6tH06socNlpN372AmtNc6YHcEIAFVC3cnPxclYiw='
WHERE
key_id = '9d151705f6b1e8c5af34fac6b97488e52392b3167d0acfa879c70227e641f487'
AND (
token = 'rph6tH06socNlpN372AmtNc6YHcEIAFVC3cnPxclYiw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)