UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0wImWs5FR+Qc2V+ou8q5EWHeB4+v9yTFPKW8ONrC8cg='
WHERE
key_id = '5090ed17aedb76e7bff5598f8419e6552c367d9aa9dec4afd89d84012fed877b'
AND (
token = '0wImWs5FR+Qc2V+ou8q5EWHeB4+v9yTFPKW8ONrC8cg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)