UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RzyfnMwgn0NEkZWcVmd89bPH0w7bsN5D/IleI25ijFQ='
WHERE
key_id = 'c5d7ca35f2cc0222d6cdf569b606fcb7539f1b4f4e21c774e4c1fdd4406bd8bd'
AND (
token = 'RzyfnMwgn0NEkZWcVmd89bPH0w7bsN5D/IleI25ijFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)