UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zvmG0khYvjFKLrO6WHkYsNltCr1m346b9nw4PJXZ2us='
WHERE
key_id = 'c98e0327abebc25f557119cb45ec5e9e3cbd114b894fa589f2055e869d2c9690'
AND (
token = 'zvmG0khYvjFKLrO6WHkYsNltCr1m346b9nw4PJXZ2us='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)