UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E7e2OiZ1UXlDBh5EaJzkyctM0Q1N+z0bVSXkE2juGKg=' 
WHERE 
  key_id = '484194e6f2ae3d79b49d1a577f95277b68893288f1637b86c4dd6baf4a078400' 
  AND (
    token = 'E7e2OiZ1UXlDBh5EaJzkyctM0Q1N+z0bVSXkE2juGKg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044