UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xZsBLkZIZ8MhTx8d1TXaKmeqAzfwrCkYMLJsK7gC6rI='
WHERE
key_id = '5ab706ccf6fee35688644b52847fe9cc322437237205d64d50254027b2ff3903'
AND (
token = 'xZsBLkZIZ8MhTx8d1TXaKmeqAzfwrCkYMLJsK7gC6rI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)