UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ECGp9n0nCbbffcHkCoud2kL4FxmcoC6s+13zFqZ2gOs='
WHERE
key_id = '5bb433e4f81fecf387173df958ac36e3c60b6d5434511f07bb78df6ae543d4c9'
AND (
token = 'ECGp9n0nCbbffcHkCoud2kL4FxmcoC6s+13zFqZ2gOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)