UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ud5HTSIfcTHC5PgcuWJPYcc3G+8GHWFG8G7QtkdNaY='
WHERE
key_id = '096caf64aaa77a3a42a85ec3387e4effe88e6966188fa5142fdf2b71ce9b0a24'
AND (
token = '9ud5HTSIfcTHC5PgcuWJPYcc3G+8GHWFG8G7QtkdNaY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)