UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L/FhsddteoRaWk/+fCzIuUy+nVYL4j9/EvubwSJj1Ls=' 
WHERE 
  key_id = '3232b95efe7bceb8e86d4b4982f24efe5839a178dd803015df463dd05a598afd' 
  AND (
    token = 'L/FhsddteoRaWk/+fCzIuUy+nVYL4j9/EvubwSJj1Ls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028