UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i9/1wT6hklyf1C6YRmKWR1s/0fcVe85dwIb6nX7fJGU=' 
WHERE 
  key_id = '782adc7d3924772728aa8d05ff43d8bba3631bd5eeed30f74fb57a446350f232' 
  AND (
    token = 'i9/1wT6hklyf1C6YRmKWR1s/0fcVe85dwIb6nX7fJGU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048