UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q1li8i7V2SVaUg5KiuOuwZHVwtnhEcXVGifsvW2p6xQ=' 
WHERE 
  key_id = '8488dd0a8ad1579f73880ebe71c035ba3a311384525e962c9f033d0aa4e2ceb9' 
  AND (
    token = 'Q1li8i7V2SVaUg5KiuOuwZHVwtnhEcXVGifsvW2p6xQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035