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