UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6uEty4TBuFBdndIwK2U+89fiOB7xdB8zrnS2ftSCZTw='
WHERE
key_id = 'cd9e9afdedf869ae5b1d92a0f7f6a3bc5b2c9e9d7a0a72a76e215a121365b226'
AND (
token = '6uEty4TBuFBdndIwK2U+89fiOB7xdB8zrnS2ftSCZTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)