UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L3qV2YSK+UkrZoZlEduZ0bj2LpLrcoWt5r4GnrqWWoo=' 
WHERE 
  key_id = '482c3f6b2afd4c0cfaaf7f566cb542eae5036259aadde10643a03101052b755e' 
  AND (
    token = 'L3qV2YSK+UkrZoZlEduZ0bj2LpLrcoWt5r4GnrqWWoo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038