UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IZa6LoUci/dsyKux8QuOMS+DpWDuu9OUj1D0eIzZTMk='
WHERE
key_id = 'a2903f813e27345695c50bfa488916a6668ad1a9b45eb2d2b950f11c2f79274e'
AND (
token = 'IZa6LoUci/dsyKux8QuOMS+DpWDuu9OUj1D0eIzZTMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)