UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LNNkzZ0ycXBg3pWPx/fyskh+BBOpivr6PyJTwymA/hA=' 
WHERE 
  key_id = '84f73e2e834c198b07b423f7b28e8fcd5bfb5635430d318e068a3a9a950def7c' 
  AND (
    token = 'LNNkzZ0ycXBg3pWPx/fyskh+BBOpivr6PyJTwymA/hA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051