UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C+3EnbQzZOOdLClNkUuOL0V7Wj9bCViLcdJUfxH2/V4=' 
WHERE 
  key_id = '5adb5f156c1a2430b32cc6d105cbdf32b50711c52b4eeba63c01009989f85c80' 
  AND (
    token = 'C+3EnbQzZOOdLClNkUuOL0V7Wj9bCViLcdJUfxH2/V4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020