UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Df7e/3ojuTuFU7UAKOWFan00PAdG44FIJ+hkCqwynbQ=' 
WHERE 
  key_id = '234356713bc062595944c7b93b5299b88e05429243a0b0644c509e8799a1a159' 
  AND (
    token = 'Df7e/3ojuTuFU7UAKOWFan00PAdG44FIJ+hkCqwynbQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042