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