UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R1Vq66BHLDwUt14nk1jpf7I6PO3TESRwah5hVFR0FQk=' 
WHERE 
  key_id = '7e03df7337d40896e2eb91c63b6aebd52a86d310a52105c2cc1b8642eb6b9ae7' 
  AND (
    token = 'R1Vq66BHLDwUt14nk1jpf7I6PO3TESRwah5hVFR0FQk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027