UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FJ4a1SdlLybAYqqvlRh8zXUrs+pEBNmNHqQUPKv3yP0=' 
WHERE 
  key_id = '934fd81d4b2d13b9bb126fcc722f6b11cfbdbf4867c664f06b3b598dafa4f70b' 
  AND (
    token = 'FJ4a1SdlLybAYqqvlRh8zXUrs+pEBNmNHqQUPKv3yP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043