UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AC9UHycFpchDR3euA/0N2HcoMTYNzWfLDb/giHjUMLs=' 
WHERE 
  key_id = 'e0b943b442fd2546345b5c70884444a76bbf98a16a250e938efc52a52a94dede' 
  AND (
    token = 'AC9UHycFpchDR3euA/0N2HcoMTYNzWfLDb/giHjUMLs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017