UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+xkFFARMJ3+9KhmgKMwZRObk1RChlHfOTwHVxYO1+Ws='
WHERE
key_id = '2fbcdd99f40f030b0c4a252c91acd64262e8897f93f34a5dd31213f6846fabc0'
AND (
token = '+xkFFARMJ3+9KhmgKMwZRObk1RChlHfOTwHVxYO1+Ws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)