UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9YoD5qRcH5O0L92nM84Idv59/mnT+I7I8CEuTOTgA2Q='
WHERE
key_id = '09f63199b55c5478fd82384554eefe3e8dd9fe01a329bae3e2f5f01b7e9b38ef'
AND (
token = '9YoD5qRcH5O0L92nM84Idv59/mnT+I7I8CEuTOTgA2Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)