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