UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SreUEYpOyGjDcEZ7/0/blwReOCY8CrR7nCvY4ElkWiI=' 
WHERE 
  key_id = '8bfc8cc28b02db130965989601f6c4afb3379cbd1b43898addf78ee28a23f4f1' 
  AND (
    token = 'SreUEYpOyGjDcEZ7/0/blwReOCY8CrR7nCvY4ElkWiI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025