UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UmMVaRth13cdvMvo3u3qbx0BrH5vsA6OQuWtMek9doo=' 
WHERE 
  key_id = '972d3dd56772c6c36f91e159327521dce20aa78b192dc84c35bac2f6fe82b59f' 
  AND (
    token = 'UmMVaRth13cdvMvo3u3qbx0BrH5vsA6OQuWtMek9doo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033