UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xkWEkmMSq6MXUJ1x0VnxP2loAfJOARM6snJcVcKDEKw='
WHERE
key_id = '855545d1a6f715387e94418d47e9a475b902d1058a24b5968711be98d58de1c5'
AND (
token = 'xkWEkmMSq6MXUJ1x0VnxP2loAfJOARM6snJcVcKDEKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)