UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'geL6BpgnilmNf8RyiXZFhgN3zw/iTMbc8uUrWtqvwYM=' 
WHERE 
  key_id = 'cc4a2d8603ba46d1dc54f99e05659078cceafce3acf001f2806be59f15d09a59' 
  AND (
    token = 'geL6BpgnilmNf8RyiXZFhgN3zw/iTMbc8uUrWtqvwYM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045