UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Po+5VXtUfEvktunOef4Hj/S0glPuP0St0dCjX5maGtQ='
WHERE
key_id = 'd6dff3a3f2aa93a4e4c2257e853cc860f428859e94adc1d67493e2713af4163a'
AND (
token = 'Po+5VXtUfEvktunOef4Hj/S0glPuP0St0dCjX5maGtQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)