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