UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jlEbLdis47qdL70s7fECsQ0mvqHruAqreQQA2buaXvc='
WHERE
key_id = '27835c3e57f777c29fa415306ac3b99fcde122f1160b2a4ee41a91160d831ff0'
AND (
token = 'jlEbLdis47qdL70s7fECsQ0mvqHruAqreQQA2buaXvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)