UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G+QqGYFQiZ9cEGGmEqw2vufU+ehSu5p2cpCrrfwmi/I='
WHERE
key_id = 'a08fefcebf69fbc3a99e0351cffefc0b8b50a04b270fb9a4ce54a0ca329457e2'
AND (
token = 'G+QqGYFQiZ9cEGGmEqw2vufU+ehSu5p2cpCrrfwmi/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)