UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5VllBqw7NNuX1qLH7NGZjyePX44gfzT0HZcCZcdTeeY='
WHERE
key_id = 'b454fcf4ae2a2ea7f88b98cdb6e0c6af056925f20973eb862ae59eca8a68573b'
AND (
token = '5VllBqw7NNuX1qLH7NGZjyePX44gfzT0HZcCZcdTeeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)