UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3uyAIDesA15cNaWe/MMabDpAEnNkpwsGbtRE7S4Nybo=' 
WHERE 
  key_id = '383d7d72d47a634c2ea1394927101a3963b0b9f8352a3c28e7189c42bd1c76b5' 
  AND (
    token = '3uyAIDesA15cNaWe/MMabDpAEnNkpwsGbtRE7S4Nybo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032