UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nGMc329dflS0WuejIVwsg5cVHX/p9zWL+bDgn+BokHA='
WHERE
key_id = '5180c7bcd584fb754ef67b22b29b0b76787bd8a303c731ccfa429d2f959f1df8'
AND (
token = 'nGMc329dflS0WuejIVwsg5cVHX/p9zWL+bDgn+BokHA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)