UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xLWNUpvJeNK/vV49IgXzzHJeUh/1knKy/64gg3XxtJk='
WHERE
key_id = '3fa5bb78585812c0bddfabdae9432bcf36b7e8a7ac6e83f38305af05cbc0d1be'
AND (
token = 'xLWNUpvJeNK/vV49IgXzzHJeUh/1knKy/64gg3XxtJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)