UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Biaw3oqdvN0fzxgyIPZjiZUkNy9xo6GtlcsJ/ZUpaEs='
WHERE
key_id = 'f7931b90703a0f794bf87865f4488600df61479d8e6e1eedecddf8c0dff1a91a'
AND (
token = 'Biaw3oqdvN0fzxgyIPZjiZUkNy9xo6GtlcsJ/ZUpaEs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)