UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FrtylyrNzVkc/MzljRWsWbFODAEHYxYlx96MqeEt7qQ='
WHERE
key_id = 'b3772400fc43eaf92de3913284113e1726e0995da91c76680c040cbfac02b9f8'
AND (
token = 'FrtylyrNzVkc/MzljRWsWbFODAEHYxYlx96MqeEt7qQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)