UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oU5aQNjkc6TBVPl/7nhPdPSnW3bldyFjZpukudMrwok='
WHERE
key_id = '3140d6c921117f2b4faffbf639f5731cfac9a0e69bfb1ec1f14faa2f6951ba59'
AND (
token = 'oU5aQNjkc6TBVPl/7nhPdPSnW3bldyFjZpukudMrwok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)