UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RnTI3EQ/QQaJHULal+/+uTHGGXkfoSWNlwfsnYlOVNk=' 
WHERE 
  key_id = '8253ef34f6adb11cee14c3382e5b4aa2696c916eb48231eaf8e2155b06588016' 
  AND (
    token = 'RnTI3EQ/QQaJHULal+/+uTHGGXkfoSWNlwfsnYlOVNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038