UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dijdd+FoZwAP05iRhFKQ9Ld1oPv9cNPhL81HFlrheuw='
WHERE
key_id = 'f49fc98aacd54ff5f8e3b83ae8ed81200a07a0af7a41aeb28ee85ab0a8131915'
AND (
token = 'dijdd+FoZwAP05iRhFKQ9Ld1oPv9cNPhL81HFlrheuw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)