UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DPiR/N/3oY+JFS2+YWwU/RguxbAyiENs1+FMHwTX5wY='
WHERE
key_id = 'cf5674ac36d4d9ee33e36ad80f59dc9bf22b657bd41b606366228dfc8d1a4873'
AND (
token = 'DPiR/N/3oY+JFS2+YWwU/RguxbAyiENs1+FMHwTX5wY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)