UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wOaX+NFJ8rJI0cA74tjb/hJkzBTMdDYLXGGkTcl6yZE='
WHERE
key_id = 'd83b7675e0482a3ca8c48a404e65819b44f6f928292efc6dd09bdef53e1d1995'
AND (
token = 'wOaX+NFJ8rJI0cA74tjb/hJkzBTMdDYLXGGkTcl6yZE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)