UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+eOe5r/Zg+RPOyr6P0o0N2IqVzUwoSJem6GfiYjS4Lo=' 
WHERE 
  key_id = 'f719b68ad3e8bb261f0b016ae6921f08f32a404b77b78535f1e9e8c5052ca43e' 
  AND (
    token = '+eOe5r/Zg+RPOyr6P0o0N2IqVzUwoSJem6GfiYjS4Lo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055